package com.xxx.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxx.server.pojo.Notice;
import com.xxx.server.mapper.NoticesMapper;
import com.xxx.server.service.INoticesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 公告 服务实现类
 * </p>
 *
 * @author cd
 * @since 2023-12-19
 */
@Service
public class NoticesServiceImpl extends ServiceImpl<NoticesMapper, Notice> implements INoticesService {
    @Autowired
    private NoticesMapper noticesMapper;


    @Override
    public Notice getNotice() {
        LambdaQueryWrapper<Notice> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Notice::getState, "1");
        Notice notice = noticesMapper.selectOne(wrapper);
        return notice;
    }
}
